package com.hkd.user_service.api;

import com.hkd.common.api.ApiResponse;
import com.hkd.user_service.api.entity.SysUser;
import com.hkd.user_service.api.fallback.SysUserServiceImplFallback;
import com.hkd.user_service.api.vo.BaseUserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author HKD
 * @date 2022/8/20 18:09
 */
//@Component
@FeignClient(contextId = "sysUserService",
        name = "user-service",
        fallbackFactory = SysUserServiceImplFallback.class
//        path = "feignUser"
)
public interface SysUserService {
    /**
     * 初始化系统角色
     * @return
     */
    @GetMapping("init")
    ApiResponse initSysUser();

    @GetMapping("getUserByAccount")
    ApiResponse<BaseUserInfo> getUserByAccount(@RequestParam("account") String account);

    @GetMapping("getUserById")
    ApiResponse<BaseUserInfo> getUserById(@RequestParam("userId") String userId);


}
